﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ToDoIt2.Aspects;
using ToDoIt2.Model.Persistent;
using ToDoIt2.Model.Persistent.UI;
using System.Collections;
using pklib.Manip;
using System.Collections.ObjectModel;

namespace ToDoIt2.UI {
	[NotifyPropertyChangedAttribute]
	class ItemViewModel : IEnumerable {
		private Item									Item;
		private TabPrefs								TabPrefs;
		private FilteredObservableCollection<Item>		Children = new FilteredObservableCollection<Item>();

		public string Title { get { return this.Item.Title; } set { this.Item.Title = value; } }

		public ItemViewModel(TabPrefs TabPrefs, Item Item) {
			this.TabPrefs = TabPrefs;
			this.Item = Item;
			this.Children = new FilteredObservableCollection<Item>(this.Item.Children as ObservableCollection<Item>);
		}

		public System.Collections.IEnumerator GetEnumerator() {	return Children.GetEnumerator(); }
	}
}
